package base.sort;

public class SelectSort {

	public static void simpleSelectSort(){
		int [] sortNum = {1,8,2,9,10,5,0,4,6,7,3};
		int min;
		for (int i = 0; i < sortNum.length; i++) {
			min = i;
			for (int j = i + 1; j < sortNum.length; j++) {
				if(sortNum[min] > sortNum [j])
					min = j;
			}
			
			if(min != i){
				int tmp = sortNum[min];
				sortNum[min] = sortNum[i];
				sortNum[i] = tmp;
			}
				
		}
		
		for (int i = 0; i < sortNum.length; i++) {
			System.out.println(sortNum[i]);
		}
	}
	
	public static void main(String [] s){
		SelectSort.simpleSelectSort();
	}
}
